package be.idamf.flash.amf
{
	import be.idamf.flash.filesystem.FileStorage;
	import be.idamf.media.domain.Album;
	import be.idamf.media.domain.Artist;
	import be.idamf.media.domain.Track;
	
	import flash.filesystem.File;
	import flash.net.FileReference;
	import flash.trace.Trace;
	import flash.utils.ByteArray;
	
	public class TestData
	{
		public static function get data():Array
		{
			var array:Array = [];
			var album:Album;
			var artist:Artist;
			var track:Track;
			var tracks:Array;
			var title:String;
			var trackId:int = 0;
			var trackIndex:int;
			
			artist = new Artist();
			artist.name = "Joy Division";
			
			album = new Album();
			album.albumId = 1;
			album.artist = artist;
			album.title = "Unknown Pleasures";
			album.tracks = [];
			
			tracks = ["Disorder", "Day of the Lords", "Candidate", "Insight", "New Dawn Fades", "She's Lost Control", "Shadowplay", "Wilderness", "Interzone", "I Remember Nothing"];
			trackIndex = 0;
			
			for each (title in tracks)
			{
				track = new Track();
				track.album = album;
				track.artist = artist;
				track.trackId = trackId++;
				track.trackIndex = trackIndex++;
				track.title = title;
				album.tracks.push(track);
			}
			
			array.push(album);
			
			var file:File = File.desktopDirectory.resolvePath("data.amf3");
			FileStorage.saveObject(file, array);
			
			return array;
		}
		
		public function TestData()
		{
		}
	}
}